package com.sean.findme;

import java.util.HashMap;
import java.util.Map;

import android.content.Context;

public class FmActivityMgrCtrller {
	
	private String curActivityMgrName = null;
	private Map<String,FmActivityManager> controllers = null;
	
	//private String[] names = new String[]{"NearActivityManager","EnjoyActivityManager","SearchActivityManager","OtherActivityManager"};
	
	private Context ctx = null;
	private static FmActivityMgrCtrller instance = null;

	public FmActivityMgrCtrller(Context ctx) {
		this.ctx = ctx;
		controllers = new HashMap<String, FmActivityManager>();
		instance = this;
	}
	
	public void setCurActivityMgr( String name )
	{
		curActivityMgrName = name;
	}
	
	public FmActivityManager getCurActivityMgr()
	{
		return controllers.get(curActivityMgrName);
	}
	
	public static FmActivityMgrCtrller getInstance( Context ctx )
	{
		if( instance == null )
			instance = new FmActivityMgrCtrller(ctx);
		return instance;
	}
	
	public void registerActivityMgr( String key, FmActivityManager mgr )
	{
		this.controllers.put(key, mgr);
	}
	

}
